﻿var status = -1;

function start() {
    cm.sendOk("來吧!");
}

function action(mode, type, selection) {
    if (mode == 1 && cm.getMap().getAllMonster().size() == 0) {
        var eim = cm.getEventInstance();
        if (eim != null) {
            var em = eim.getEventManager();
            if (cm.getMapId() == 800024500) {
    var mob = em.getMonster(9400080);
    var modified = em.newMonsterStats();
    modified.setOExp(mob.getMobExp());
    modified.setOHp(mob.getMobMaxHp() * 5);
    modified.setOMp(mob.getMobMaxMp() * 5);
                eim.registerMonster(mob);
                var map = eim.getMapInstance(0);
                map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(279, -28));
                cm.removeNpc(cm.getMapId(), 9113001);
                if (!cm.getPlayer().isGM()) {
                    cm.getMap().startSpeedRun();
                }
            } else {
                var mob = em.getMonster(8840013);//普通
                eim.registerMonster(mob);
                var map = eim.getMapInstance(0);
                map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(-5, -181));
                cm.removeNpc(cm.getMapId(), 2161000);
                if (!cm.getPlayer().isGM()) {
                    cm.getMap().startSpeedRun();
                }
            }
        }
    }
    cm.dispose();
}
